//
//  UIScreen.swift
//  Documentation
//
//  Created by Toj on 2/7/23.
//

extension UIScreen {

    
    @available(iOS 3.2, *)
    public class let didConnectNotification: NSNotification.Name

    // Object is the UIScreen that represented the disconnected screen.
    @available(iOS 3.2, *)
    public class let didDisconnectNotification: NSNotification.Name

    // Object is the UIScreen which changed. [object currentMode] is the new UIScreenMode.
    @available(iOS 3.2, *)
    public class let modeDidChangeNotification: NSNotification.Name

    @available(iOS 5.0, *)
    public class let brightnessDidChangeNotification: NSNotification.Name

    // Object is the UIScreen which changed. [object isCaptured] is the new value of captured property.
    @available(iOS 11.0, *)
    public class let capturedDidChangeNotification: NSNotification.Name

    
    // when the connected screen is overscanning, UIScreen can attempt to compensate for the overscan to avoid clipping
    public enum OverscanCompensation : Int {

        
        case scale = 0 // the final composited framebuffer for the screen is scaled to avoid clipping

        case insetBounds = 1 // the screen's bounds will be inset in the framebuffer to avoid clipping. no scaling will occur

        @available(iOS 9.0, *)
        case none = 2 // no scaling will occur. use overscanCompensationInsets to determine the necessary insets to avoid clipping

        
        @available(iOS, introduced: 5.0, deprecated: 9.0, renamed: "UIScreen.OverscanCompensation.none")
        public static var insetApplicationFrame: UIScreen.OverscanCompensation { get }
    }
}

@available(iOS 2.0, *)
open class UIScreen : NSObject, UITraitEnvironment {

    
    @available(iOS 3.2, *)
    open class var screens: [UIScreen] { get } // all screens currently attached to the device

    open class var main: UIScreen { get } // the device's internal screen

    
    open var bounds: CGRect { get } // Bounds of entire screen in points

    @available(iOS 4.0, *)
    open var scale: CGFloat { get }

    
    @available(iOS 3.2, *)
    open var availableModes: [UIScreenMode] { get } // The list of modes that this screen supports

    @available(iOS 4.3, *)
    open var preferredMode: UIScreenMode? { get } // Preferred mode of this screen. Choosing this mode will likely produce the best results

    
    // Current mode of this screen
    
    @available(iOS 3.2, *)
    open var currentMode: UIScreenMode? // Current mode of this screen

    
    @available(iOS 5.0, *)
    open var overscanCompensation: UIScreen.OverscanCompensation // Default is UIScreenOverscanCompensationScale. Determines how the screen behaves if the connected display is overscanning

    
    @available(iOS 9.0, *)
    open var overscanCompensationInsets: UIEdgeInsets { get } // The amount that should be inset to avoid clipping

    
    @available(iOS 4.3, *)
    open var mirrored: UIScreen? { get } // The screen being mirrored by the receiver. nil if mirroring is disabled or unsupported. Moving a UIWindow to this screen will disable mirroring

    @available(iOS 11.0, *)
    open var isCaptured: Bool { get } // True if this screen is being captured (e.g. recorded, AirPlayed, mirrored, etc.)

    
    @available(iOS 5.0, *)
    open var brightness: CGFloat // 0 .. 1.0, where 1.0 is maximum brightness. Only supported by main screen.

    @available(iOS 5.0, *)
    open var wantsSoftwareDimming: Bool // Default is NO. If YES, brightness levels lower than that of which the hardware is capable are emulated in software, if necessary. Having enabled may entail performance cost.

    
    @available(iOS 8.0, *)
    open var coordinateSpace: UICoordinateSpace { get }

    @available(iOS 8.0, *)
    open var fixedCoordinateSpace: UICoordinateSpace { get }

    
    @available(iOS 8.0, *)
    open var nativeBounds: CGRect { get } // Native bounds of the physical screen in pixels

    @available(iOS 8.0, *)
    open var nativeScale: CGFloat { get } // Native scale factor of the physical screen

    
    @available(iOS 4.0, *)
    open func displayLink(withTarget target: Any, selector sel: Selector) -> CADisplayLink?

    
    @available(iOS 10.3, *)
    open var maximumFramesPerSecond: Int { get } // The maximumFramesPerSecond this screen is capable of

    
    // The latency of the display hardware associated with this screen.
    // Can be used along with CoreAudio devices' kAudioDeviceLatencyProperty to
    // achieve A/V sync when writing custom video playback software.
    // Will be `0` if display latency has not been calibrated by the user.
    @available(iOS 13.0, *)
    open var calibratedLatency: CFTimeInterval { get }

    
    @available(iOS, introduced: 10.0, deprecated: 15.0, message: "Use -[UIWindowScene focusSystem].focusedItem instead")
    weak open var focusedItem: UIFocusItem? { get }

    @available(iOS, introduced: 9.0, deprecated: 15.0, message: "Use -[UIWindowScene focusSystem].focusedItem instead")
    weak open var focusedView: UIView? { get }

    @available(iOS, introduced: 9.0, deprecated: 15.0, message: "Use -[UIWindowScene focusSystem] != nil instead")
    open var supportsFocus: Bool { get }

    
    @available(iOS, introduced: 2.0, deprecated: 9.0)
    open var applicationFrame: CGRect { get }
}
